package com.dau.api.controller;

import com.dau.common.result.R;
import com.dau.entity.customer.LuckyDraw;
import com.dau.service.customer.draw.LuckyDrawService;
import jakarta.annotation.Resource;
import jakarta.validation.constraints.NotNull;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * api幸运抽奖控制器
 *
 * @author tzj
 * @date 2024/12/17
 */
@RestController
@RequestMapping("api/luckyDraw")
@Validated
public class ApiLuckDrawController {
    @Resource
    private LuckyDrawService luckyDrawService;

    /**
     * 幸运抽奖
     *
     * @return {@link R }<{@link LuckyDraw }>
     */
    @GetMapping("/go")
    public R<LuckyDraw> luckyDraw(@NotNull(message = "活动ID不能为空")Long activityId) {
        return R.success(luckyDrawService.luckyDraw(activityId));
    }
}
